package brad.zimmerman.dungeon.game;

import java.io.Serializable;


public class ClassResultHolder implements Serializable{
	
	//This class is mainly to hold the non-serializable gameStats class info between activities
	public boolean checkBoss;
	public String playerLeft;
	public String playerRight;
	public String playerBottom;
	public int player_race;
	public int player_class;
	public int player_level;
	public int playerID;
	public int player_gold;
	public int endingMultiplier;
	public int calculateScore;
	public int player_rank;
	public int stepsTaken;
	public String rankTitle;
	
	ClassResultHolder(ClassGameStats playerStats){
		this.checkBoss = playerStats.checkBoss;
		this.playerLeft = playerStats.playerLeft();
		this.playerRight = playerStats.playerRight();
		this.playerBottom = playerStats.playerBottom();
		this.player_race = playerStats.player_race;
		this.player_class = playerStats.player_class;
		this.player_level = playerStats.player_level;
		this.playerID = playerStats.playerID;
		this.player_gold = playerStats.player_gold;
		this.endingMultiplier = playerStats.endingMultiplier;
		this.calculateScore = playerStats.calculateScore();
		this.player_rank = playerStats.player_rank;
		this.rankTitle = playerStats.rankTitle();
		this.stepsTaken = playerStats.stepsTaken;
	}
	
	ClassResultHolder(
			boolean checkBoss,
			String playerLeft,
			String playerRight,
			String playerBottom,
			int player_race,
			int player_class,
			int player_level,
			int playerID,
			int player_gold,
			int endingMultiplier,
			int calculateScore,
			int player_rank,
			int stepsTaken,
			String rankTitle){
		this.checkBoss = checkBoss;
		this.playerLeft = playerLeft;
		this.playerRight = playerRight;
		this.playerBottom = playerBottom;
		this.player_race = player_race;
		this.player_class = player_class;
		this.player_level = player_level;
		this.playerID = playerID;
		this.player_gold = player_gold;
		this.endingMultiplier = endingMultiplier;
		this.calculateScore = calculateScore;
		this.player_rank = player_rank;
		this.rankTitle = rankTitle;
		this.stepsTaken = stepsTaken;
	}
	
	public void printInfo(){
		System.out.println(checkBoss);
		System.out.println(playerLeft);
		System.out.println(playerRight);
		System.out.println(playerBottom);
		System.out.println(player_race);
		System.out.println(player_class);
		System.out.println(player_level);
		System.out.println(playerID);
		System.out.println(player_gold);
		System.out.println(endingMultiplier);
		System.out.println(calculateScore);
		System.out.println(player_rank);
		System.out.println(stepsTaken);
		System.out.println(rankTitle);
	}
	
	public int[] determineGreater(int hRank, int hScore, int hStepsTaken, int hCompleted){
		int[] holder = new int[4];
		if(player_rank > hRank){holder[0] = player_rank;}
		else{holder[0] = hRank;}
		if(calculateScore>hScore){holder[1] = calculateScore;}
		else{holder[1] = hScore;}
		if(stepsTaken<hStepsTaken){holder[2] = stepsTaken;}
		else{holder[2] = hStepsTaken;}
		if(checkBoss){holder[3] = 1;}
		else{holder[3] = hCompleted;}
		return holder;
	}

}
